<template>
  <div class="sintelligent-search-container">
    <div class="search-top-text">
      <h2>资信智查</h2>
      <div class="sinte-search-btn" @click="handleSearchPage">搜索资信信息</div>
    </div>
    <div class="search-bottom-bg"></div>
  </div>
</template>

<script>
import { getAccessToken } from "@/api";
import { Cookie } from "@/utils";
export default {
  name: "IntelligentSearch",
  data() {
    return {};
  },
  created() {
    //获取accessToken
    this.getAccessTokenInfo();
  },
  methods: {
    //跳转到搜索页面
    handleSearchPage() {
      this.$router.push({ name: "SearchCreditInfo" });
    },

    /**
     * 获取accessToken
     */
    async getAccessTokenInfo() {
      //请求接口 获取accessToken
      const accessToken = await getAccessToken({
        mx_sso_token: localStorage.getItem("mx_sso_token"),
      });

      //存储accessToken
      Cookie.setCookie("accessToken", accessToken);
    },
  },
};
</script>

<style lang="less" scoped>
@import url("~@/assets/styles/intelligentSearch/index.less");
</style>